#ifndef THIRDPARTY_LOGGING_LOGGER_STREAM_H_
#define THIRDPARTY_LOGGING_LOGGER_STREAM_H_
#pragma once
#include "thirdparty/logging/fixed_buffer.h"
namespace logging{
class LoggerStream {
 public:
  typedef FixedBuffer<100000> SmallBuffer;
  typedef LoggerStream Self;
  LoggerStream();
  LoggerStream& operator<<(short);
  LoggerStream& operator<<(unsigned short);
  LoggerStream& operator<<(int);
  LoggerStream& operator<<(unsigned int);
  LoggerStream& operator<<(long);
  LoggerStream& operator<<(unsigned long);
  LoggerStream& operator<<(long long);
  LoggerStream& operator<<(unsigned long long);
  LoggerStream& operator<<(const void*);
  LoggerStream& operator<<(double);
  LoggerStream& operator<<(float);
  LoggerStream& operator<<(char);
  LoggerStream& operator<<(const char*);
  LoggerStream& operator<<(const unsigned char*);
  LoggerStream& operator<<(const std::string&);
  bool Append(const char* data, uint32_t len);
  SmallBuffer& Buffer();
  void ResetBuffer(){
    buffer_->Reset();
  }

 private:
  static thread_local std::unique_ptr<SmallBuffer> buffer_;
  static const uint32_t kMaxNumbericSize = 32;
  template<typename T>
  void ConvertInterger(T);

};

}
#endif  // THIRDPARTY_LOGGING_LOGGER_STREAM_H_
